package demo6;
/**
 * 单例模式
 */
public class Singleton {
    private static Singleton singleton = new Singleton();
    private Singleton()
    {
        System.out.println("单例模式创建对象");
    }
    public static Singleton getSingleton()
    {
        return singleton;
    }
}
